home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / pwrbat23.zip / PB20DEMO.PWR < prev    next >
Text File  |  1996-05-09  |  17KB  |  443 lines

  1. Variable        Fore,1                 ;save areas for initial colors
  2. Variable        Back,1
  3. Variable        ColorAttr,3
  4. Variable        Prn,3
  5. Variable        CharIn,1             ;for user responses
  6. Variable        FnKey,1
  7. Variable        RedOnGray,3,116
  8. Variable        RedOnBlack,3,4
  9. Variable        YelOnBlue,3,30
  10. Variable        YelOnGray,3,126
  11. Variable        BlueOnGray,3,113
  12. Variable        F1,1,#59            ;key value for F1
  13. Variable        ID,4
  14. Variable        MainTitle,36,'126PowerBatch 116Functions'
  15. Variable        M1L1,34,'116Get 126S116ystem Information'
  16. Variable        M1L2,22,'116Draw 126B116oxes'
  17. Variable        M1L3,35,'116Get Input From 126K116eyboard'
  18. Variable        M1L4,28,'116St126R116ing Functions'
  19. Variable        M1L5,25,'116Screen 126W116rites'
  20. Variable        M1L6,21,'126M116iscellaneous'
  21. Variable        M2L1,25,'116Current 126C116olor'
  22. Variable        M2L2,29,'116Current 126D116irectory'
  23. Variable        M2L3,24,'116Current Da126T116e'
  24. Variable        M2L4,21,'116Disk126S116pace'
  25. Variable        M2L5,29,'126E116nvironment Variables'
  26. Variable        M2L6,24,'116Current Ti126M116e'
  27. Variable        Msg,78
  28. Variable        EscMsg,13,' Esc To Quit '
  29. Variable        ContMsg,25,'Press Any Key To Continue'
  30. Variable        ColorMsg1,78,'PowerBatch will supply you with the current foreground, background, and'
  31. Variable        ColorMsg2,78,'composite color by issuing the command ?COLOR. This message is displayed'
  32. Variable        ColorMsg3,78,'using the color attributes active when DEMO2 was started.'
  33. Variable        DOW,9                ;for date command
  34. Variable        Mo,2
  35. Variable        Da,2
  36. Variable        Yr,4
  37. Variable        CurrTime,11          ;for current time
  38. Variable        DriveLtr,1
  39. Variable        DirName,78           ;for user entered directory name
  40. Variable        FileName,78          ;for user entered file name
  41. Variable        Space35,35,"                                   "
  42. Variable        Space76,76,"                                                                            "
  43. Variable        TotSpace,10
  44. Variable        AvailSpace,10
  45. Variable        Msg2,78
  46. Variable        FName,35
  47. Variable        LName,35
  48. ?Color          Fore,Back,ColorAttr  ;initial color
  49. ?Date           DOW,Mo,Da,Yr         ;get system date
  50. ?Time           CurrTime             ;get system time
  51. Cursor            2
  52. Clear
  53. SetVar            CharIn,DispAdapter
  54. Compare         CharIn,"C",,,ColorMon
  55. WriteLine        'This demo is designed to run on a color monitor'
  56. Halt
  57. Label           ColorMon
  58. Clear            YelOnGray            ;clear to my color
  59. Box4            25,2,51,16,116
  60. WriteAt         28,2,MainTitle
  61. WriteAt         27,4,M1L1
  62. WriteAt         27,6,M1L2
  63. WriteAt         27,8,M1L3
  64. WriteAt         27,10,M1L4
  65. WriteAt         27,12,M1L5
  66. WriteAt         27,14,M1L6
  67. WriteAt         33,16,EscMsg
  68. Label            GetM1
  69. GoToXY            39,15
  70. Write            ' '
  71. GoToXY            39,15
  72. ReadUpKey        CharIn
  73. Compare         CharIn,'',,,Finis
  74. Compare         CharIn,'S',,,SysInfo
  75. Compare         CharIn,'B',,,BoxInfo
  76. Compare         CharIn,'K',,,KeyBdInfo
  77. Compare         CharIn,'R',,,StrInfo
  78. Compare         CharIn,'W',,,WritInfo
  79. Compare         CharIn,'M',,,MiscInfo
  80. Beep            800,1
  81. Beep            300,2
  82. GoTo            GetM1
  83. Label        SysInfo
  84. Box4            40,4,64,18,116
  85. Color            RedOnGray
  86. WriteAt         43,4,'System Information'
  87. WriteAt         42,6,M2L1
  88. WriteAt         42,8,M2L2
  89. WriteAt         42,10,M2L3
  90. WriteAt         42,12,M2L4
  91. WriteAt         42,14,M2L5
  92. WriteAt         42,16,M2L6
  93. WriteAt         48,18,EscMsg
  94. Label        GetM2
  95. GoToXY            52,17
  96. Write            ' '
  97. GoToXy            52,17
  98. ReadUpKey        CharIn
  99. Compare         CharIn,'',,,ColorMon
  100. Compare         CharIn,'C',,,ColorInfo
  101. Compare         CharIn,'D',,,DirInfo
  102. Compare         CharIn,'T',,,DateInfo
  103. Compare         CharIn,'S',,,SpaceInfo
  104. Compare         CharIn,'E',,,EnvirInfo
  105. Compare         CharIn,'M',,,TimeInfo
  106. Beep            800,1
  107. Beep            300,2
  108. GoTo            GetM2
  109. Label       ColorInfo
  110. WriteAt         2,20,ColorMsg1,ColorAttr
  111. WriteAt         2,21,ColorMsg2,ColorAttr
  112. WriteAt         2,22,ColorMsg3,ColorAttr
  113. GoTo        M2Cont
  114. Label        DirInfo
  115. SetVar            DriveLtr,'A'
  116. ?CurrDir        DriveLtr,DirName
  117. Concat            Msg,'Drive A current directory is ',DirName
  118. WriteAt         2,20,Msg
  119. Label        DrC
  120. SetVar            DriveLtr,'C'
  121. ?DriveExist     DriveLtr,DrCOK
  122. WriteAt         2,21,'No drive C defined in your system.'
  123. GoTo            M2Cont
  124. Label        DrCOK
  125. ?CurrDir        DriveLtr,DirName
  126. Concat            Msg,'Drive C current directory is ',DirName
  127. WriteAt         2,21,Msg
  128. SetVar            DriveLtr,'D'
  129. ?DriveExist     DriveLtr,DrDOK
  130. WriteAt         2,22,'No drive D defined in your system.'
  131. GoTo            M2Cont
  132. Label        DrDOK
  133. ?CurrDir        DriveLtr,DirName
  134. Concat            Msg,'Drive D current directory is ',DirName
  135. WriteAt         2,22,Msg
  136. GoTo            M2Cont
  137. Label        DateInfo
  138. Concat            Msg,'Today is ',DOW
  139. Concat            Msg,' '
  140. Concat            Msg,Mo
  141. Concat            Msg,'/'
  142. Concat            Msg,Da
  143. Concat            Msg,'/'
  144. Concat            Msg,Yr
  145. WriteAt         2,20,Msg
  146. GoTo            M2Cont
  147. Label        SpaceInfo
  148. WriteAt         2,20,'Enter drive letter '
  149. ReadUpKey        DriveLtr
  150. ?DriveExist     DriveLtr,ValidDr
  151. WriteAt         2,20,'Invalid Drive !!!  '
  152. GoTo            GetM2
  153. Label            ValidDr
  154. ?DiskSpace        DriveLtr,TotSpace,AvailSpace
  155. Compare         TotSpace,0,,DrNotRdy,DrNotRdy
  156. Concat            Msg,'Drive ',DriveLtr
  157. Concat            Msg,' has a capacity of '
  158. Concat            Msg,TotSpace
  159. Concat            Msg,' bytes. The disk has '
  160. Concat            Msg,AvailSpace
  161. Concat            Msg,' bytes free.'
  162. WriteAt         2,20,Msg
  163. GoTo            M2Cont
  164. Label        DrNotRdy
  165. WriteAt         2,20,'Drive not ready !!!'
  166. GoTo            M2Cont
  167. Label        EnvirInfo
  168. ?EnvStr         'PATH',DirName
  169. Concat            Msg,'Current path is ',DirName
  170. WriteAt         2,20,Msg
  171. ?EnvStr         'PROMPT',DirName
  172. Concat            Msg,'Your prompt command is ',DirName
  173. WriteAt         2,21,Msg
  174. ?EnvStr         'COMSPEC',DirName
  175. Concat            Msg,'Your command processor is ',DirName
  176. WriteAt         2,22,Msg
  177. GoTo            M2Cont
  178. Label        TimeInfo
  179. WriteAt         27,23,ContMsg,RedOnGray
  180. Label        UpdtTime
  181. ?Time           CurrTime
  182. Concat            Msg,'Your system time is currently ',CurrTime
  183. WriteAt         2,20,Msg
  184. ReadKey         CharIn,,1
  185. Compare         CharIn,'',,,UpdtTime
  186. ClearBox        1,19,78,24,YelOnGray
  187. GoTo            GetM2
  188. Label        M2Cont
  189. WriteAt         27,23,ContMsg,RedOnGray
  190. ReadKey         CharIn
  191. ClearLine        20,RedOnGray
  192. ClearLine        21,RedOnGray
  193. ClearLine        22,RedOnGray
  194. GoTo            GetM2
  195. Label       BoxInfo
  196. Clear
  197. Box1            10,2,55,15,116
  198. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  199. WriteAt         14,6,'A single line border'
  200. Wait            50
  201. Box2            10,2,55,15,116
  202. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  203. WriteAt         14,6,'A double line border'
  204. Wait            30
  205. Box3            10,2,55,15,116
  206. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  207. WriteAt         14,6,'A solid line border'
  208. Wait            30
  209. Box4            10,2,55,15,116,,15
  210. WriteAt         12,4,'PowerBatch draws four types of boxes...'
  211. WriteAt         14,6,'A single line border with a shadow'
  212. Wait            30
  213. WriteAt         14,8,'You can clear the contents of a box'
  214. WriteAt         14,9,'without redrawing the box or clearing'
  215. WriteAt         14,10,'the screen...'
  216. Wait            50
  217. ClearBox        10,2,55,15,116
  218. WriteAt         12,4,'Boxes can be drawn so quickly they can'
  219. WriteAt         12,5,'be made to appear to move.'
  220. Wait            50
  221. ClearBox        9,1,58,16,116
  222. Box1            11,3,56,16,116
  223. ClearBox        10,2,57,17,116
  224. Box1            12,4,57,17,116
  225. ClearBox        11,3,58,18,116
  226. Box1            13,5,58,18,116
  227. ClearBox        12,4,59,19,116
  228. Box1            14,6,59,19,116
  229. ClearBox        13,5,60,20,116
  230. Box1            15,7,60,20,116
  231. ClearBox        14,6,61,21,116
  232. Box1            16,8,61,21,116
  233. ClearBox        15,7,62,22,116
  234. Box4            17,9,62,22,116,,15
  235. WriteAt         19,11,'Boxes can be drawn so quickly they can'
  236. WriteAt         19,12,'be made to appear to move.'
  237. Wait            50
  238. GoTo            ColorMon
  239. Label       KeyBdInfo
  240. Clear
  241. Box1        5,5,75,19,116
  242. WriteAt     7,7,'There are several keyboard read functions in PowerBatch.'
  243. WriteAt     7,8,'You can read a single character (and only one character) from the'
  244. WriteAt     7,9,'keyboard, including all special characters like Alt-F1; you can'
  245. WriteAt     7,10,'read a string of a specified length and not accept any additional'
  246. WriteAt     7,11,'characters; you can read a single key and change the character'
  247. WriteAt     7,12,'to upper case regardless of the case entered; and you can read'
  248. WriteAt     7,13,'a key in response to a (Y)es or (N)o question, forcing the key'
  249. WriteAt     7,14,'to upper case Y or N, and accepting no other characters.'
  250. WriteAt     7,16,'For Example...'
  251. Label        ForceF1
  252. WriteAt     14,17,'Press F1 for Help '
  253. ReadKey     CharIn,FnKey
  254. Compare     FnKey,1,,,SpecKey
  255. Beep        500,3
  256. GoTo        ForceF1
  257. Label        SpecKey
  258. Compare     CharIn,F1,,,GotF1
  259. Beep        500,3
  260. GoTo        ForceF1
  261. Label        GotF1
  262. WriteAt     14,17,'H